#include <stddef.h>
#ifndef LINKER_TABLE_H_CB1636FD111E25C49AC43B40D1B27EAA
#define LINKER_TABLE_H_CB1636FD111E25C49AC43B40D1B27EAA   1

class TLinkerUniverTabItem
{
public:
    virtual void MoveFrom(TLinkerUniverTabItem *p);
    virtual TLinkerUniverTabItem * GetOffsetItem(size_t index);
    virtual ~TLinkerUniverTabItem();
};

class TLinkerUniverTabItemGroup
{
public:
    TLinkerUniverTabItemGroup * prev;
    TLinkerUniverTabItemGroup * next;
    TLinkerUniverTabItem * groupdata;

    TLinkerUniverTabItemGroup()
    {
        prev = NULL;
        next = NULL;
        groupdata = NULL;
    }
};

class TLinkerUniverTab
{
private:
    size_t                      group_base;
    size_t                      alloc_total;
    size_t                      elem_total;
    TLinkerUniverTabItemGroup * head;
    TLinkerUniverTabItemGroup * rear;

    void IncreaseGroupAlloc();
    virtual TLinkerUniverTabItem* AllocGroupData(size_t count);
public:
    TLinkerUniverTab(size_t _group_base);
    ~TLinkerUniverTab();

    size_t MoveElemInto(TLinkerUniverTabItem & elem);
    size_t MoveElemInto(TLinkerUniverTabItem * pelem);
    TLinkerUniverTabItem* GetItem(size_t index);
    size_t GetTotalCount(void);
};


#endif  //LINKER_TABLE_H_CB1636FD111E25C49AC43B40D1B27EAA

